# Contributor: Rasmus Thomsen <oss@cogitri.dev>
# Maintainer: Rasmus Thomsen <oss@cogitri.dev>
pkgname=gnome-podcasts
pkgver=0.4.8
pkgrel=0
pkgdesc="Podcast app for GNOME"
url="https://wiki.gnome.org/Apps/Podcasts"
arch="all !s390x !mips !mips64" # rust crashing on x86, missing deps on s390x and mips
license="GPL-3.0-or-later"
depends="gst-plugins-base gst-plugins-bad"
makedepends="meson gtk+3.0-dev gstreamer-dev libhandy-dev sqlite-dev openssl-dev
	dbus-dev gst-plugins-base-dev gst-plugins-bad-dev cargo bash"
checkdepends="desktop-file-utils appstream-glib xvfb-run"
subpackages="$pkgname-lang"
source="https://gitlab.gnome.org/World/podcasts/uploads/cf61f00c7ac92ddef81c4f5ed7e737a7/gnome-podcasts-$pkgver.tar.xz"

prepare() {
	default_prepare

	sed 's| /usr/bin/sh|/bin/sh|' -i scripts/test.sh
}

build() {
	meson \
		--prefix=/usr \
		--sysconfdir=/etc \
		--mandir=/usr/share/man \
		--localstatedir=/var \
		--buildtype=plain \
		. output
	ninja -C output
}

check() {
	xvfb-run ninja -C output test
}

package() {
	DESTDIR="$pkgdir" ninja -C output install
}

sha512sums="2083c63a45c8a4608667d4300e1a28cf6c7bd7f375ee7eaa0e377e96cac37bf8c5c79efaea0872ca4b69b219254b711681be20e40b03c6366cc60eecbd223338  gnome-podcasts-0.4.8.tar.xz"
